package com.sa.ibiz.demo.mob.controller.demo.vo;

import java.sql.Timestamp;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.util.StringUtils;
import com.sa.ibiz.demo.demo.domain.QJ;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.Map;
import java.util.Date;
import org.springframework.cglib.beans.BeanCopier;
import javax.validation.constraints.Size;
import java.util.UUID;
import org.springframework.cglib.beans.BeanCopier;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sa.ibiz.demo.ibizutil.security.AuthenticationUser;
import java.math.BigInteger;
import com.alibaba.fastjson.JSONObject;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class QJ_EditForm_MobForm20{

    @JsonProperty(access=Access.WRITE_ONLY)
    private Map<String,String> srfparentdata;
    @JsonIgnore
    private Timestamp updatedate;
    @JsonProperty(access=Access.WRITE_ONLY)
    private String srforikey;
    @JsonIgnore
    private String qjid;
    @JsonIgnore
    private String qjname;
    @JsonIgnore
    private String srftempmode;
    @JsonProperty
    private String srfuf;
    @JsonProperty
    private String srfdeid;
    @JsonProperty(access=Access.WRITE_ONLY)
    private String srfsourcekey;
    @JsonIgnore
    private Timestamp kssj;
    @JsonIgnore
    private Timestamp jssj;
    @JsonIgnore
    private Double qjts;
    @JsonIgnore
    private String yysm;
    @JsonIgnore
    private String fj;
    @JsonIgnore
    private String qjwfstate;

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    @JsonProperty(value = "srfupdatedate")
    public Timestamp getSrfupdatedate(){
        return updatedate;
    }
    @JsonProperty(value = "srfupdatedate")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    public void setSrfupdatedate(Timestamp updatedate){
        this.updatedate = updatedate;
    }

    @JsonProperty(value = "srforikey")
    public String getSrforikey(){
        return srforikey;
    }
    @JsonProperty(value = "srforikey")
    public void setSrforikey(String srforikey){
        this.srforikey = srforikey;
    }

    @Size(min = 0, max = 100, message = "[请假标识]长度必须在[100]以内!")
    @JsonProperty(value = "srfkey")
    public String getSrfkey(){
        return qjid;
    }
    @JsonProperty(value = "srfkey")
    public void setSrfkey(String qjid){
        this.qjid = qjid;
    }

    @Size(min = 0, max = 200, message = "[请假名称]长度必须在[200]以内!")
    @JsonProperty(value = "srfmajortext")
    public String getSrfmajortext(){
        return qjname;
    }

    @JsonProperty(value = "srftempmode")
    public String getSrftempmode(){
        return srftempmode;
    }
    @JsonProperty(value = "srftempmode")
    public void setSrftempmode(String srftempmode){
        this.srftempmode = srftempmode;
    }

    @JsonProperty(value = "srfdeid")
    public String getSrfdeid(){
        return srfdeid;
    }
    @JsonProperty(value = "srfdeid")
    public void setSrfdeid(String srfdeid){
        this.srfdeid = srfdeid;
    }

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    @JsonProperty(value = "kssj")
    public Timestamp getKssj(){
        return kssj;
    }
    @JsonProperty(value = "kssj")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    public void setKssj(Timestamp kssj){
        this.kssj = kssj;
    }

    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    @JsonProperty(value = "jssj")
    public Timestamp getJssj(){
        return jssj;
    }
    @JsonProperty(value = "jssj")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
    public void setJssj(Timestamp jssj){
        this.jssj = jssj;
    }

    @JsonProperty(value = "qjts")
    public Double getQjts(){
        return qjts;
    }
    @JsonProperty(value = "qjts")
    public void setQjts(Double qjts){
        this.qjts = qjts;
    }

    @Size(min = 0, max = 500, message = "[请假原有说明]长度必须在[500]以内!")
    @JsonProperty(value = "yysm")
    public String getYysm(){
        return yysm;
    }
    @JsonProperty(value = "yysm")
    public void setYysm(String yysm){
        this.yysm = yysm;
    }

    @Size(min = 0, max = 1000, message = "[附件]长度必须在[1000]以内!")
    @JsonProperty(value = "fj")
    public String getFj(){
        return fj;
    }
    @JsonProperty(value = "fj")
    public void setFj(String fj){
        this.fj = fj;
    }

    @Size(min = 0, max = 60, message = "[业务状态]长度必须在[60]以内!")
    @JsonProperty(value = "qjwfstate")
    public String getQjwfstate(){
        if(StringUtils.isEmpty(qjwfstate)){
        if(isCreate()){
            this.qjwfstate="10";
        }
        }
        return qjwfstate;
    }
    @JsonProperty(value = "qjwfstate")
    public void setQjwfstate(String qjwfstate){
        this.qjwfstate = qjwfstate;
    }

    @Size(min = 0, max = 200, message = "[请假名称]长度必须在[200]以内!")
    @JsonProperty(value = "qjname")
    public String getQjname(){
        if(StringUtils.isEmpty(qjname)){
        if(isCreate()){
            this.qjname="事假";
        }
        }
        return qjname;
    }
    @JsonProperty(value = "qjname")
    public void setQjname(String qjname){
        this.qjname = qjname;
    }

    @Size(min = 0, max = 100, message = "[请假标识]长度必须在[100]以内!")
    @JsonProperty(value = "qjid")
    public String getQjid(){
        return qjid;
    }
    @JsonProperty(value = "qjid")
    public void setQjid(String qjid){
        this.qjid = qjid;
    }

    public  void fromQJ(QJ sourceEntity)  {
        this.fromQJ(sourceEntity,true);
    }

     /**
	 * do转换为vo
	 * @param sourceEntity do数据对象
	 * @return
	 */
    public  void fromQJ(QJ sourceEntity,boolean reset)  {
      BeanCopier copier=BeanCopier.create(QJ.class, QJ_EditForm_MobForm20.class, false);
      copier.copy(sourceEntity,this,  null);
      this.toString();
	}

    /**
	 * vo转换为do
	 * @param
	 * @return
	 */
    public  QJ toQJ()  {
        QJ targetEntity =new QJ();
        BeanCopier copier=BeanCopier.create(QJ_EditForm_MobForm20.class, QJ.class, false);
        copier.copy(this, targetEntity, null);
        return targetEntity;
	}

     /**
	 * 新建
	 * @param
	 * @return
	 */
    private boolean isCreate()
    {
    	if((StringUtils.isEmpty(this.srfuf))||this.srfuf.equals("0"))
	    	return true;
    	else
    	    return false;
    }
     /**
	 * 更新
	 * @param
	 * @return
	 */
    private boolean isUpdate()
    {
    	if((!StringUtils.isEmpty(this.srfuf))&&this.srfuf.equals("1"))
	    	return true;
    	else
    	    return false;
    }

}
